<?php 
//时间戳本周时间
date_default_timezone_set('Asia/Shanghai');
$ftime = mktime ( 0, 0, 0, date ( "m" ), date ( "d" ) - date ( "w" ) + 1, date ( "Y" ) );
$ltime = mktime ( 23, 59, 59, date ( "m" ), date ( "d" ) - date ( "w" ) + 7, date ( "Y" ) );
echo date('d',$ftime),'<br />';
echo date('d',time()),'<br />';
echo date('d',time())-date('d',$ftime),'<br/>';
echo date('Y-m-d',$ftime),'<br />';
echo date('Y-m-d',$ltime);

//本月
$year = date("Y");
   $month = date("m");
   $allday = date("t");
   $start = strtotime($year."-".$month."-1");
   $end = strtotime($year."-".$month."-".$allday);

 ?>